<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<title>MD3 (file format) - Wikipedia, the free encyclopedia</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta name="generator" content="MediaWiki 1.16alpha-wmf" />
<link rel="alternate" type="application/x-wiki" title="Edit this page" href="/w/index.php?title=MD3_(file_format)&amp;action=edit" />
<link rel="edit" title="Edit this page" href="/w/index.php?title=MD3_(file_format)&amp;action=edit" />
<link rel="apple-touch-icon" href="http://en.wikipedia.org/apple-touch-icon.png" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="search" type="application/opensearchdescription+xml" href="/w/opensearch_desc.php" title="Wikipedia (en)" />
<link rel="copyright" href="http://creativecommons.org/licenses/by-sa/3.0/" />
<link rel="alternate" type="application/rss+xml" title="Wikipedia RSS Feed" href="/w/index.php?title=Special:RecentChanges&amp;feed=rss" />
<link rel="alternate" type="application/atom+xml" title="Wikipedia Atom Feed" href="/w/index.php?title=Special:RecentChanges&amp;feed=atom" />
<link rel="stylesheet" href="/skins-1.5/common/shared.css?243z2" type="text/css" media="screen" />
<link rel="stylesheet" href="/skins-1.5/common/commonPrint.css?243z2" type="text/css" media="print" />
<link rel="stylesheet" href="/skins-1.5/monobook/main.css?243z2" type="text/css" media="screen" />
<link rel="stylesheet" href="/skins-1.5/chick/main.css?243z2" type="text/css" media="handheld" />
<!--[if lt IE 5.5000]><link rel="stylesheet" href="/skins-1.5/monobook/IE50Fixes.css?243z2" type="text/css" media="screen" /><![endif]-->
<!--[if IE 5.5000]><link rel="stylesheet" href="/skins-1.5/monobook/IE55Fixes.css?243z2" type="text/css" media="screen" /><![endif]-->
<!--[if IE 6]><link rel="stylesheet" href="/skins-1.5/monobook/IE60Fixes.css?243z2" type="text/css" media="screen" /><![endif]-->
<!--[if IE 7]><link rel="stylesheet" href="/skins-1.5/monobook/IE70Fixes.css?243z2" type="text/css" media="screen" /><![endif]-->
<link rel="stylesheet" href="/w/index.php?title=MediaWiki:Common.css&amp;usemsgcache=yes&amp;ctype=text%2Fcss&amp;smaxage=2678400&amp;action=raw&amp;maxage=2678400" type="text/css" media="all" />
<link rel="stylesheet" href="/w/index.php?title=MediaWiki:Print.css&amp;usemsgcache=yes&amp;ctype=text%2Fcss&amp;smaxage=2678400&amp;action=raw&amp;maxage=2678400" type="text/css" media="print" />
<link rel="stylesheet" href="/w/index.php?title=MediaWiki:Handheld.css&amp;usemsgcache=yes&amp;ctype=text%2Fcss&amp;smaxage=2678400&amp;action=raw&amp;maxage=2678400" type="text/css" media="handheld" />
<link rel="stylesheet" href="/w/index.php?title=MediaWiki:Monobook.css&amp;usemsgcache=yes&amp;ctype=text%2Fcss&amp;smaxage=2678400&amp;action=raw&amp;maxage=2678400" type="text/css" media="all" />
<link rel="stylesheet" href="/w/index.php?title=-&amp;action=raw&amp;maxage=2678400&amp;gen=css" type="text/css" media="all" />
<script type="text/javascript">
var skin="monobook",
stylepath="/skins-1.5",
wgArticlePath="/wiki/$1",
wgScriptPath="/w",
wgScriptExtension=".php",
wgScript="/w/index.php",
wgVariantArticlePath=false,
wgActionPaths={},
wgServer="http://en.wikipedia.org",
wgCanonicalNamespace="",
wgCanonicalSpecialPageName=false,
wgNamespaceNumber=0,
wgPageName="MD3_(file_format)",
wgTitle="MD3 (file format)",
wgAction="view",
wgArticleId=8509632,
wgIsArticle=true,
wgUserName=null,
wgUserGroups=null,
wgUserLanguage="en",
wgContentLanguage="en",
wgBreakFrames=false,
wgCurRevisionId=321603583,
wgVersion="1.16alpha-wmf",
wgEnableAPI=true,
wgEnableWriteAPI=true,
wgSeparatorTransformTable=["", ""],
wgDigitTransformTable=["", ""],
wgMainPageTitle="Main Page",
wgFormattedNamespaces={"-2": "Media", "-1": "Special", "0": "", "1": "Talk", "2": "User", "3": "User talk", "4": "Wikipedia", "5": "Wikipedia talk", "6": "File", "7": "File talk", "8": "MediaWiki", "9": "MediaWiki talk", "10": "Template", "11": "Template talk", "12": "Help", "13": "Help talk", "14": "Category", "15": "Category talk", "100": "Portal", "101": "Portal talk"},
wgNamespaceIds={"media": -2, "special": -1, "": 0, "talk": 1, "user": 2, "user_talk": 3, "wikipedia": 4, "wikipedia_talk": 5, "file": 6, "file_talk": 7, "mediawiki": 8, "mediawiki_talk": 9, "template": 10, "template_talk": 11, "help": 12, "help_talk": 13, "category": 14, "category_talk": 15, "portal": 100, "portal_talk": 101, "wp": 4, "wt": 5, "image": 6, "image_talk": 7},
wgMWSuggestTemplate="http://en.wikipedia.org/w/api.php?action=opensearch\x26search={searchTerms}\x26namespace={namespaces}\x26suggest",
wgDBname="enwiki",
wgSearchNamespaces=[0],
wgMWSuggestMessages=["with suggestions", "no suggestions"],
wgRestrictionEdit=[],
wgRestrictionMove=[],
wgNotice="",
wgNoticeLocal="";
</script>
<script src="/skins-1.5/common/wikibits.js?urid=243z2_1254880607" type="text/javascript"></script>
<script src="/skins-1.5/common/ajax.js?urid=243z2" type="text/javascript"></script>
<script src="/skins-1.5/common/mwsuggest.js?urid=243z2" type="text/javascript"></script>
<script type="text/javascript" src="http://upload.wikimedia.org/centralnotice/wikipedia/en/centralnotice.js?243z2"></script>

<!--[if lt IE 7]><script type="text/javascript" src="/skins-1.5/common/IEFixes.js?243z2"></script>
	<meta http-equiv="imagetoolbar" content="no" /><![endif]-->
<script src="/w/index.php?title=-&amp;action=raw&amp;gen=js&amp;useskin=monobook&amp;urid=243z2_319406805" type="text/javascript"></script>

</head>
<body class="mediawiki ltr ns-0 ns-subject page-MD3_file_format skin-monobook">
	<div id="globalWrapper">
		<div id="column-content">
	<div id="content">
		<a id="top"></a>
		<div id="siteNotice"><script type='text/javascript'>if (wgNotice != '') document.writeln(wgNotice);</script></div>		<h1 id="firstHeading" class="firstHeading">MD3 (file format)</h1>
		<div id="bodyContent">
			<h3 id="siteSub">From Wikipedia, the free encyclopedia</h3>
			<div id="contentSub"></div>
									<div id="jump-to-nav">Jump to: <a href="#column-one">navigation</a>, <a href="#searchInput">search</a></div>			<!-- start content -->
			<div class="thumb tright">
<div class="thumbinner" style="width:182px;"><a href="/wiki/File:MD3Q3Sarge.png" class="image"><img alt="" src="http://upload.wikimedia.org/wikipedia/en/thumb/5/53/MD3Q3Sarge.png/180px-MD3Q3Sarge.png" width="180" height="137" class="thumbimage" /></a>
<div class="thumbcaption">
<div class="magnify"><a href="/wiki/File:MD3Q3Sarge.png" class="internal" title="Enlarge"><img src="/skins-1.5/common/images/magnify-clip.png" width="15" height="11" alt="" /></a></div>
Example of two MD3 model assets from <a href="/wiki/Id_Tech_3" title="Id Tech 3">Quake III Arena</a> that have been linked together using tags.</div>
</div>
</div>
<p><b>MD3</b> is a model format used by the <a href="/wiki/Id_Tech_3" title="Id Tech 3">Quake 3 engine</a> as well as its many mods. The format is used mostly for player models and non-structural geometry (non-static models) although it may be used for structural uses. Unlike modern formats, animations are not bone based but instead <a href="/wiki/Per-vertex_animation" title="Per-vertex animation" class="mw-redirect">vertex</a> based and are directly contained within the file.</p>
<table id="toc" class="toc">
<tr>
<td>
<div id="toctitle">
<h2>Contents</h2>
</div>
<ul>
<li class="toclevel-1 tocsection-1"><a href="#File_format"><span class="tocnumber">1</span> <span class="toctext">File format</span></a>
<ul>
<li class="toclevel-2 tocsection-2"><a href="#MD3_header"><span class="tocnumber">1.1</span> <span class="toctext">MD3 header</span></a>
<ul>
<li class="toclevel-3 tocsection-3"><a href="#Frame"><span class="tocnumber">1.1.1</span> <span class="toctext">Frame</span></a></li>
<li class="toclevel-3 tocsection-4"><a href="#Tag"><span class="tocnumber">1.1.2</span> <span class="toctext">Tag</span></a></li>
<li class="toclevel-3 tocsection-5"><a href="#Surface"><span class="tocnumber">1.1.3</span> <span class="toctext">Surface</span></a>
<ul>
<li class="toclevel-4 tocsection-6"><a href="#Shader"><span class="tocnumber">1.1.3.1</span> <span class="toctext">Shader</span></a></li>
<li class="toclevel-4 tocsection-7"><a href="#Triangle"><span class="tocnumber">1.1.3.2</span> <span class="toctext">Triangle</span></a></li>
<li class="toclevel-4 tocsection-8"><a href="#TexCoord"><span class="tocnumber">1.1.3.3</span> <span class="toctext">TexCoord</span></a></li>
<li class="toclevel-4 tocsection-9"><a href="#Vertex"><span class="tocnumber">1.1.3.4</span> <span class="toctext">Vertex</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-2 tocsection-10"><a href="#Normals"><span class="tocnumber">1.2</span> <span class="toctext">Normals</span></a>
<ul>
<li class="toclevel-3 tocsection-11"><a href="#Encoding"><span class="tocnumber">1.2.1</span> <span class="toctext">Encoding</span></a></li>
<li class="toclevel-3 tocsection-12"><a href="#Decoding"><span class="tocnumber">1.2.2</span> <span class="toctext">Decoding</span></a></li>
</ul>
</li>
</ul>
</li>
<li class="toclevel-1 tocsection-13"><a href="#See_also"><span class="tocnumber">2</span> <span class="toctext">See also</span></a></li>
<li class="toclevel-1 tocsection-14"><a href="#Resources"><span class="tocnumber">3</span> <span class="toctext">Resources</span></a></li>
</ul>
</td>
</tr>
</table>
<script type="text/javascript">
//<![CDATA[
if (window.showTocToggle) { var tocShowText = "show"; var tocHideText = "hide"; showTocToggle(); } 
//]]>
</script>
<h2><span class="editsection">[<a href="/w/index.php?title=MD3_(file_format)&amp;action=edit&amp;section=1" title="Edit section: File format">edit</a>]</span> <span class="mw-headline" id="File_format">File format</span></h2>
<table class="wikitable">
<tr>
<th>Data Type</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td>U8</td>
<td>char</td>
<td>8-bit unsigned octet (character)</td>
</tr>
<tr>
<td>S16</td>
<td>short</td>
<td>little-endian signed 16-bit integer</td>
</tr>
<tr>
<td>S32</td>
<td>int</td>
<td>little-endian signed 32-bit integer</td>
</tr>
<tr>
<td>F32</td>
<td>float</td>
<td>IEEE-754 32-bit floating-point</td>
</tr>
<tr>
<td>VEC3</td>
<td>vec3_t</td>
<td>triplet of F32 in sequence (read 4 octets, make float, read 4, make float, read 4, make float), describing a 3-space vector</td>
</tr>
<tr>
<td>*</td>
<td>[]</td>
<td>indicates sequential repeat count (homogenous aggregation, array, vector), as in "U8 * 16" to mean a 16-octet array (i.e. character string</td>
</tr>
<tr>
<td>-</td>
<td></td>
<td>file/array offset of which to make special note</td>
</tr>
<tr>
<td>&#160;!</td>
<td></td>
<td>aggregate complex data that should be described elsewhere</td>
</tr>
</table>
<h3><span class="editsection">[<a href="/w/index.php?title=MD3_(file_format)&amp;action=edit&amp;section=2" title="Edit section: MD3 header">edit</a>]</span> <span class="mw-headline" id="MD3_header">MD3 header</span></h3>
<table class="wikitable">
<tr>
<th>Data Type</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td>-</td>
<td>MD3_START</td>
<td>Offset of MD3 object. Usually 0, but not guaranteed.</td>
</tr>
<tr>
<td>S32</td>
<td>IDENT</td>
<td>Magic number. As a string of 4 octets, reads "IDP3"; as unsigned little-endian 860898377 (0x33504449); as unsigned big-endian 1229213747 (0x49445033).</td>
</tr>
<tr>
<td>S32</td>
<td>VERSION</td>
<td>MD3 version number, latest known is 15, but use the constant MD3_VERSION.</td>
</tr>
<tr>
<td>U8 * 64</td>
<td>NAME</td>
<td>MD3 name, usually its pathname in the PK3. ASCII character string, NUL-terminated (C-style).</td>
</tr>
<tr>
<td>S32</td>
<td>FLAGS</td>
<td>&#160;???</td>
</tr>
<tr>
<td>S32</td>
<td>NUM_FRAMES</td>
<td>Number of Frame objects, with a maximum of MD3_MAX_FRAMES. Current value of MD3_MAX_FRAMES is 1024.</td>
</tr>
<tr>
<td>S32</td>
<td>NUM_TAGS</td>
<td>Number of Tag objects, with a maximum of MD3_MAX_TAGS. Current value of MD3_MAX_TAGS is 16. There is one set of tags per frame so the total number of tags to read is (NUM_TAGS * NUM_FRAMES).</td>
</tr>
<tr>
<td>S32</td>
<td>NUM_SURFACES</td>
<td>Number of Surface objects, with a maximum of MD3_MAX_SURFACES. Current value of MD3_MAX_SURFACES is 32.</td>
</tr>
<tr>
<td>S32</td>
<td>NUM_SKINS</td>
<td>Number of Skin objects. I should note that I have not seen an MD3 using this particular field for anything; this appears to be an artifact from the Quake 2 MD2 format. Surface objects have their own Shader field.</td>
</tr>
<tr>
<td>S32</td>
<td>OFS_FRAMES</td>
<td>Relative offset from start of MD3 object where Frame objects start. The Frame objects are written sequentially, that is, when you read one Frame object, you do not need to seek() for the next object.</td>
</tr>
<tr>
<td>S32</td>
<td>OFS_TAGS</td>
<td>Relative offset from start of MD3 where Tag objects start. Similarly written sequentially.</td>
</tr>
<tr>
<td>S32</td>
<td>OFS_SURFACES</td>
<td>Relative offset from start of MD3 where Surface objects start. Again, written sequentially.</td>
</tr>
<tr>
<td>S32</td>
<td>OFS_EOF</td>
<td>Relative offset from start of MD3 to the end of the MD3 object. Note there is no offset for Skin objects.</td>
</tr>
<tr>
<td>&#160;!</td>
<td>(Frame)</td>
<td>The array of Frame objects usually starts immediately afterwards, but OFS_FRAMES should be used.</td>
</tr>
<tr>
<td>&#160;!</td>
<td>(Tag)</td>
<td>The array of Tag objects usually starts immediately after FRAMES, but OFS_TAGS should be used.</td>
</tr>
<tr>
<td>&#160;!</td>
<td>(Surface)</td>
<td>The array of Surface objects usually start after TAGS, but OFS_SURFACES should be used.</td>
</tr>
<tr>
<td>-</td>
<td>MD3_END</td>
<td>End of MD3 object. Should match MD3_START.</td>
</tr>
</table>
<h4><span class="editsection">[<a href="/w/index.php?title=MD3_(file_format)&amp;action=edit&amp;section=3" title="Edit section: Frame">edit</a>]</span> <span class="mw-headline" id="Frame">Frame</span></h4>
<p>General properties of a single animation frame.</p>
<table class="wikitable">
<tr>
<th>Data Type</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td>VEC3</td>
<td>MIN_BOUNDS</td>
<td>First corner of the bounding box.</td>
</tr>
<tr>
<td>VEC3</td>
<td>MAX_BOUNDS</td>
<td>Second corner of the bounding box.</td>
</tr>
<tr>
<td>VEC3</td>
<td>LOCAL_ORIGIN</td>
<td>Local origin, usually (0, 0, 0).</td>
</tr>
<tr>
<td>F32</td>
<td>RADIUS</td>
<td>Radius of bounding sphere.</td>
</tr>
<tr>
<td>U8 * 16</td>
<td>NAME</td>
<td>Name of Frame. ASCII character string, NUL-terminated (C-style)</td>
</tr>
</table>
<h4><span class="editsection">[<a href="/w/index.php?title=MD3_(file_format)&amp;action=edit&amp;section=4" title="Edit section: Tag">edit</a>]</span> <span class="mw-headline" id="Tag">Tag</span></h4>
<p>An attachment point for another MD3 model.</p>
<table class="wikitable">
<tr>
<th>Data Type</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td>U8 * 64</td>
<td>NAME</td>
<td>Name of Tag object. ASCII character string, NUL-terminated (C-style).</td>
</tr>
<tr>
<td>VEC3</td>
<td>ORIGIN</td>
<td>Coordinates of Tag object.</td>
</tr>
<tr>
<td>VEC3 * 3</td>
<td>AXIS</td>
<td>3x3 <a href="/wiki/Rotation_matrix" title="Rotation matrix">rotation matrix</a> associated with the Tag.</td>
</tr>
</table>
<h4><span class="editsection">[<a href="/w/index.php?title=MD3_(file_format)&amp;action=edit&amp;section=5" title="Edit section: Surface">edit</a>]</span> <span class="mw-headline" id="Surface">Surface</span></h4>
<p>An animated triangle mesh.</p>
<table class="wikitable">
<tr>
<th>Data Type</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td>-</td>
<td>SURFACE_START</td>
<td>Offset relative to start of MD3 object.</td>
</tr>
<tr>
<td>S32</td>
<td>IDENT</td>
<td>Magic number. As a string of 4 octets, reads "IDP3"; as unsigned little-endian 860898377 (0x33504449); as unsigned big-endian 1229213747 (0x49445033).</td>
</tr>
<tr>
<td>U8 * 64</td>
<td>NAME</td>
<td>Name of Surface object. ASCII character string, NUL-terminated (C-style).</td>
</tr>
<tr>
<td>S32</td>
<td>FLAGS</td>
<td>&#160;???</td>
</tr>
<tr>
<td>S32</td>
<td>NUM_FRAMES</td>
<td>Number of animation frames. This should match NUM_FRAMES in the MD3 header.</td>
</tr>
<tr>
<td>S32</td>
<td>NUM_SHADERS</td>
<td>Number of Shader objects defined in this Surface, with a limit of MD3_MAX_SHADERS. Current value of MD3_MAX_SHADERS is 256.</td>
</tr>
<tr>
<td>S32</td>
<td>NUM_VERTS</td>
<td>Number of Vertex objects defined in this Surface, up to MD3_MAX_VERTS. Current value of MD3_MAX_VERTS is 4096.</td>
</tr>
<tr>
<td>S32</td>
<td>NUM_TRIANGLES</td>
<td>Number of Triangle objects defined in this Surface, maximum of MD3_MAX_TRIANGLES. Current value of MD3_MAX_TRIANGLES is 8192.</td>
</tr>
<tr>
<td>S32</td>
<td>OFS_TRIANGLES</td>
<td>Relative offset from SURFACE_START where the list of Triangle objects starts.</td>
</tr>
<tr>
<td>S32</td>
<td>OFS_SHADERS</td>
<td>Relative offset from SURFACE_START where the list of Shader objects starts.</td>
</tr>
<tr>
<td>S32</td>
<td>OFS_ST</td>
<td>Relative offset from SURFACE_START where the list of ST objects (s-t texture coordinates) starts.</td>
</tr>
<tr>
<td>S32</td>
<td>OFS_XYZNORMAL</td>
<td>Relative offset from SURFACE_START where the list of Vertex objects (X-Y-Z-N vertices) starts.</td>
</tr>
<tr>
<td>S32</td>
<td>OFS_END</td>
<td>Relative offset from SURFACE_START to where the Surface object ends.</td>
</tr>
<tr>
<td>&#160;!</td>
<td>(<a href="/wiki/Md3#Shader" title="Md3" class="mw-redirect">Shader</a>)</td>
<td>List of Shader objects usually starts immediate after the Surface header, but use OFS_SHADERS (or rather, OFS_SHADERS+OFS_SURFACES for files).</td>
</tr>
<tr>
<td>&#160;!</td>
<td>(<a href="/wiki/Md3#Triangle" title="Md3" class="mw-redirect">Triangle</a>)</td>
<td>List of Triangle objects usually starts immediately after the list of Shader objects, but use OFS_TRIANGLES (+ OFS_SURFACES).</td>
</tr>
<tr>
<td>&#160;!</td>
<td>(<a href="/wiki/Md3#TexCoord" title="Md3" class="mw-redirect">ST</a>)</td>
<td>List of ST objects usually starts immediately after the list of Triangle objects, but use OFS_ST (+ OFS_SURFACES).</td>
</tr>
<tr>
<td>&#160;!</td>
<td>(<a href="/wiki/Md3#Vertex" title="Md3" class="mw-redirect">XYZNormal</a>)</td>
<td>List of Vertex objects usually starts immediate after the list of St objects, but use OFS_XYZNORMALS (+ OFS_SURFACES). The total number of objects is (NUM_FRAMES * NUM_VERTS). One set of NUM_VERTS Vertex objects describes the Surface in one frame of animation; the first NUM_VERTS Vertex objects describes the Surface in the first frame of animation, the second NUM_VERTEX Vertex objects describes the Surface in the second frame of animation, and so forth.</td>
</tr>
<tr>
<td>-</td>
<td>SURFACE_END</td>
<td>End of Surface object. Should match OFS_END.</td>
</tr>
</table>
<h5><span class="editsection">[<a href="/w/index.php?title=MD3_(file_format)&amp;action=edit&amp;section=6" title="Edit section: Shader">edit</a>]</span> <span class="mw-headline" id="Shader">Shader</span></h5>
<table class="wikitable">
<tr>
<th>Data Type</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td>U8 * 64</td>
<td>NAME</td>
<td>Pathname of shader in the PK3. ASCII character string, NUL-terminated (C-style).</td>
</tr>
<tr>
<td>S32</td>
<td>SHADER_INDEX</td>
<td>Shader index number. No idea how this is allocated, but presumably in sequential order of definition.</td>
</tr>
</table>
<h5><span class="editsection">[<a href="/w/index.php?title=MD3_(file_format)&amp;action=edit&amp;section=7" title="Edit section: Triangle">edit</a>]</span> <span class="mw-headline" id="Triangle">Triangle</span></h5>
<table class="wikitable">
<tr>
<th>Data Type</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td>S32 * 3</td>
<td>INDEXES</td>
<td>List of offset values into the list of Vertex objects that constitute the corners of the Triangle object. Vertex numbers are used instead of actual coordinates, as the coordinates are implicit in the Vertex object. The triangles have clockwise winding.</td>
</tr>
</table>
<h5><span class="editsection">[<a href="/w/index.php?title=MD3_(file_format)&amp;action=edit&amp;section=8" title="Edit section: TexCoord">edit</a>]</span> <span class="mw-headline" id="TexCoord">TexCoord</span></h5>
<table class="wikitable">
<tr>
<th>Data Type</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td>F32 * 2</td>
<td>ST</td>
<td>s and t texture coordinates, normalized to the range [0, 1]. Values outside the range indicate wraparounds/repeats. Unlike <a href="/wiki/UV_Mapping" title="UV Mapping" class="mw-redirect">UV</a> coordinates, the origin for texture coordinates is located in the upper left corner (similar to the coordinate system used for computer screens) whereas, in UV mapping, it is placed in the lower left corner. As such, the t value must be flipped to correspond with UV coordinates. See also <a href="/wiki/Right-hand_rule#Left_handedness" title="Right-hand rule">Left-hand coordinates</a></td>
</tr>
</table>
<h5><span class="editsection">[<a href="/w/index.php?title=MD3_(file_format)&amp;action=edit&amp;section=9" title="Edit section: Vertex">edit</a>]</span> <span class="mw-headline" id="Vertex">Vertex</span></h5>
<table class="wikitable">
<tr>
<th>Data Type</th>
<th>Name</th>
<th>Description</th>
</tr>
<tr>
<td>S16 * 3</td>
<td>COORD</td>
<td>x, y, and z coordinates in left-handed 3-space, scaled down by factor 1.0/64. (Multiply by 1.0/64 to obtain original coordinate value.)</td>
</tr>
<tr>
<td>U8*2</td>
<td>NORMAL</td>
<td>Zenith and azimuth angles of normal vector. 255 corresponds to 2 pi. See <a href="/wiki/Spherical_coordinates" title="Spherical coordinates" class="mw-redirect">spherical coordinates</a>.</td>
</tr>
</table>
<h3><span class="editsection">[<a href="/w/index.php?title=MD3_(file_format)&amp;action=edit&amp;section=10" title="Edit section: Normals">edit</a>]</span> <span class="mw-headline" id="Normals">Normals</span></h3>
<h4><span class="editsection">[<a href="/w/index.php?title=MD3_(file_format)&amp;action=edit&amp;section=11" title="Edit section: Encoding">edit</a>]</span> <span class="mw-headline" id="Encoding">Encoding</span></h4>
<p>The normal vector uses a spherical coordinate system. Since the normal vector is, by definition, a length of one, only the angles need to be recorded. Each angle is constrained between 0 - 255 to fit in one octet. A normal vector encodes into 16 bits.</p>
<p>(Code in q3tools/common/mathlib.c:NormalToLatLong)<br />
azimuth &lt;- atan2(y, x) * 255 / (2 * pi)<br />
zenith &lt;- acos(z) * 255 / (2 * pi)<br /></p>
<h4><span class="editsection">[<a href="/w/index.php?title=MD3_(file_format)&amp;action=edit&amp;section=12" title="Edit section: Decoding">edit</a>]</span> <span class="mw-headline" id="Decoding">Decoding</span></h4>
<p>(Code in q3tools/q3map/misc_model.c:InsertMD3Model)<br />
lat &lt;- zenith * (2 * pi ) / 255<br />
lng &lt;- azimuth * (2 * pi) / 255<br />
x &lt;- cos ( lat ) * sin ( lng )<br />
y &lt;- sin ( lat ) * sin ( lng )<br />
z &lt;- cos ( lng )<br /></p>
<h2><span class="editsection">[<a href="/w/index.php?title=MD3_(file_format)&amp;action=edit&amp;section=13" title="Edit section: See also">edit</a>]</span> <span class="mw-headline" id="See_also">See also</span></h2>
<ul>
<li><a href="/wiki/Quake_III_Arena" title="Quake III Arena">Quake III Arena</a>.</li>
<li><a href="/wiki/Id_Tech_3" title="Id Tech 3">id Tech 3</a>.</li>
<li><a href="/wiki/Id_Software" title="Id Software">id Software</a>.</li>
</ul>
<h2><span class="editsection">[<a href="/w/index.php?title=MD3_(file_format)&amp;action=edit&amp;section=14" title="Edit section: Resources">edit</a>]</span> <span class="mw-headline" id="Resources">Resources</span></h2>
<p>Various post at <a href="http://www.quakesrc.org" class="external text" rel="nofollow">QuakeSrc Forums</a><br />
<a href="ftp://ftp.idsoftware.com/idstuff/source/quake3-1.32b-source.zip" class="external text" rel="nofollow">Quake3 Source</a><br />
Various discussions in <a href="/wiki/Internet_Relay_Chat" title="Internet Relay Chat">IRC</a> chats.<br />
<a href="http://linux.ucla.edu/~phaethon/q3/formats/md3format.html" class="external text" rel="nofollow">MD3 Specification by Phaethon H.</a></p>
<table class="navbox" cellspacing="0" style=";">
<tr>
<td style="padding:2px;">
<table cellspacing="0" class="nowraplinks collapsible autocollapse" style="width:100%;background:transparent;color:inherit;;">
<tr>
<th style=";" colspan="2" class="navbox-title">
<div style="float:left; width:6em;text-align:left;">
<div class="noprint plainlinks navbar" style="background:none; padding:0; font-weight:normal;;;border:none;; font-size:xx-small;"><a href="/wiki/Template:Id_Software_file_formats" title="Template:Id Software file formats"><span title="View this template" style=";;border:none;">v</span></a>&#160;<span style="font-size:80%;">•</span>&#160;<a href="/wiki/Template_talk:Id_Software_file_formats" title="Template talk:Id Software file formats"><span title="Discuss this template" style=";;border:none;">d</span></a>&#160;<span style="font-size:80%;">•</span>&#160;<a href="http://en.wikipedia.org/w/index.php?title=Template:Id_Software_file_formats&amp;action=edit" class="external text" rel="nofollow"><span title="Edit this template" style=";;border:none;;">e</span></a></div>
</div>
<span class="" style="font-size:110%;"><a href="/wiki/Id_Software" title="Id Software">id Software</a> file formats</span></th>
</tr>
<tr style="height:2px;">
<td></td>
</tr>
<tr>
<td class="navbox-group" style=";;">maps</td>
<td style="text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;" class="navbox-list navbox-odd">
<div style="padding:0em 0.25em"><a href="/wiki/Doom_WAD" title="Doom WAD">WAD</a> • <a href="/wiki/MAP_(file_format)" title="MAP (file format)">MAP</a> • <a href="/wiki/BSP_(file_format)" title="BSP (file format)">BSP</a></div>
</td>
</tr>
<tr style="height:2px">
<td></td>
</tr>
<tr>
<td class="navbox-group" style=";;">models</td>
<td style="text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;" class="navbox-list navbox-even">
<div style="padding:0em 0.25em"><a href="/wiki/MD2_(file_format)" title="MD2 (file format)">MD2</a> • <strong class="selflink">MD3</strong></div>
</td>
</tr>
<tr style="height:2px">
<td></td>
</tr>
<tr>
<td class="navbox-group" style=";;">packs</td>
<td style="text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;" class="navbox-list navbox-odd">
<div style="padding:0em 0.25em"><a href="/wiki/Doom_WAD" title="Doom WAD">WAD</a> • <a href="/wiki/PK2_(file_extension)" title="PK2 (file extension)">PK2</a> • <a href="/wiki/PK3_(file_extension)" title="PK3 (file extension)">PK3</a> • <a href="/wiki/PK4_(file_extension)" title="PK4 (file extension)">PK4</a></div>
</td>
</tr>
<tr style="height:2px">
<td></td>
</tr>
<tr>
<td class="navbox-group" style=";;">editors</td>
<td style="text-align:left;border-left-width:2px;border-left-style:solid;width:100%;padding:0px;;;" class="navbox-list navbox-even">
<div style="padding:0em 0.25em"><a href="/wiki/GtkRadiant" title="GtkRadiant">GtkRadiant</a> • <a href="/wiki/Misfit_Model_3d" title="Misfit Model 3d">Misfit Model 3d</a> • <a href="/wiki/Quake_2_Modeler" title="Quake 2 Modeler">Quake 2 Modeler</a> • <a href="/wiki/Quake_Army_Knife" title="Quake Army Knife">QuArK</a></div>
</td>
</tr>
</table>
</td>
</tr>
</table>


<!-- 
NewPP limit report
Preprocessor node count: 455/1000000
Post-expand include size: 9815/2048000 bytes
Template argument size: 1565/2048000 bytes
Expensive parser function count: 0/500
-->

<!-- Saved in parser cache with key enwiki:pcache:idhash:8509632-0!1!0!default!!en!2 and timestamp 20091023171057 -->
<div class="printfooter">
Retrieved from "<a href="http://en.wikipedia.org/wiki/MD3_(file_format)">http://en.wikipedia.org/wiki/MD3_(file_format)</a>"</div>
			<div id='catlinks' class='catlinks'><div id="mw-normal-catlinks"><a href="/wiki/Special:Categories" title="Special:Categories">Categories</a>: <span dir='ltr'><a href="/wiki/Category:CAD_file_formats" title="Category:CAD file formats">CAD file formats</a></span> | <span dir='ltr'><a href="/wiki/Category:3D_computer_graphics" title="Category:3D computer graphics">3D computer graphics</a></span> | <span dir='ltr'><a href="/wiki/Category:Quake" title="Category:Quake">Quake</a></span></div></div>			<!-- end content -->
						<div class="visualClear"></div>
		</div>
	</div>
		</div>
		<div id="column-one">
	<div id="p-cactions" class="portlet">
		<h5>Views</h5>
		<div class="pBody">
			<ul lang="en" xml:lang="en">
	
				 <li id="ca-nstab-main" class="selected"><a href="/wiki/MD3_(file_format)" title="View the content page [c]" accesskey="c">Article</a></li>
				 <li id="ca-talk"><a href="/wiki/Talk:MD3_(file_format)" title="Discussion about the content page [t]" accesskey="t">Discussion</a></li>
				 <li id="ca-edit"><a href="/w/index.php?title=MD3_(file_format)&amp;action=edit" title="You can edit this page. &#10;Please use the preview button before saving. [e]" accesskey="e">Edit this page</a></li>
				 <li id="ca-history"><a href="/w/index.php?title=MD3_(file_format)&amp;action=history" title="Past versions of this page [h]" accesskey="h">History</a></li>			</ul>
		</div>
	</div>
	<div class="portlet" id="p-personal">
		<h5>Personal tools</h5>
		<div class="pBody">
			<ul lang="en" xml:lang="en">
				<li id="pt-optin-try"><a href="http://en.wikipedia.org/w/index.php?title=Special:UsabilityInitiativeOptIn&amp;from=MD3_%28file_format%29" title="Try out new features" class="no-text-transform">Try Beta</a></li>
				<li id="pt-login"><a href="/w/index.php?title=Special:UserLogin&amp;returnto=MD3_(file_format)" title="You are encouraged to log in; however, it is not mandatory. [o]" accesskey="o">Log in / create account</a></li>
			</ul>
		</div>
	</div>
	<div class="portlet" id="p-logo">
		<a style="background-image: url(http://upload.wikimedia.org/wikipedia/en/b/bc/Wiki.png);" href="/wiki/Main_Page" title="Visit the main page"></a>
	</div>
	<script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
	<div class='generated-sidebar portlet' id='p-navigation'>
		<h5 lang="en" xml:lang="en">Navigation</h5>
		<div class='pBody'>
			<ul>
				<li id="n-mainpage-description"><a href="/wiki/Main_Page" title="Visit the main page [z]" accesskey="z">Main page</a></li>
				<li id="n-contents"><a href="/wiki/Portal:Contents" title="Guides to browsing Wikipedia">Contents</a></li>
				<li id="n-featuredcontent"><a href="/wiki/Portal:Featured_content" title="Featured content — the best of Wikipedia">Featured content</a></li>
				<li id="n-currentevents"><a href="/wiki/Portal:Current_events" title="Find background information on current events">Current events</a></li>
				<li id="n-randompage"><a href="/wiki/Special:Random" title="Load a random article [x]" accesskey="x">Random article</a></li>
			</ul>
		</div>
	</div>
	<div id="p-search" class="portlet">
		<h5 lang="en" xml:lang="en"><label for="searchInput">Search</label></h5>
		<div id="searchBody" class="pBody">
			<form action="/w/index.php" id="searchform">
				<input type='hidden' name="title" value="Special:Search"/>
				<input id="searchInput" title="Search Wikipedia" accesskey="f" value="" name="search" />
				<input type='submit' name="go" class="searchButton" id="searchGoButton"	value="Go" title="Go to a page with this exact name if one exists" />&nbsp;
				<input type='submit' name="fulltext" class="searchButton" id="mw-searchButton" value="Search" title="Search Wikipedia for this text" />
			</form>
		</div>
	</div>
	<div class='generated-sidebar portlet' id='p-interaction'>
		<h5 lang="en" xml:lang="en">Interaction</h5>
		<div class='pBody'>
			<ul>
				<li id="n-aboutsite"><a href="/wiki/Wikipedia:About" title="Find out about Wikipedia">About Wikipedia</a></li>
				<li id="n-portal"><a href="/wiki/Wikipedia:Community_portal" title="About the project, what you can do, where to find things">Community portal</a></li>
				<li id="n-recentchanges"><a href="/wiki/Special:RecentChanges" title="The list of recent changes in the wiki [r]" accesskey="r">Recent changes</a></li>
				<li id="n-contact"><a href="/wiki/Wikipedia:Contact_us" title="How to contact Wikipedia">Contact Wikipedia</a></li>
				<li id="n-sitesupport"><a href="http://wikimediafoundation.org/wiki/Donate/Now/en?utm_source=donate&amp;utm_medium=sidebar&amp;utm_campaign=spontaneous_donation" title="Support us">Donate to Wikipedia</a></li>
				<li id="n-help"><a href="/wiki/Help:Contents" title="Guidance on how to use and edit Wikipedia">Help</a></li>
			</ul>
		</div>
	</div>
	<div class="portlet" id="p-tb">
		<h5 lang="en" xml:lang="en">Toolbox</h5>
		<div class="pBody">
			<ul>
				<li id="t-whatlinkshere"><a href="/wiki/Special:WhatLinksHere/MD3_(file_format)" title="List of all English Wikipedia pages containing links to this page [j]" accesskey="j">What links here</a></li>
				<li id="t-recentchangeslinked"><a href="/wiki/Special:RecentChangesLinked/MD3_(file_format)" title="Recent changes in pages linked from this page [k]" accesskey="k">Related changes</a></li>
<li id="t-upload"><a href="/wiki/Wikipedia:Upload" title="Upload files [u]" accesskey="u">Upload file</a></li>
<li id="t-specialpages"><a href="/wiki/Special:SpecialPages" title="List of all special pages [q]" accesskey="q">Special pages</a></li>
				<li id="t-print"><a href="/w/index.php?title=MD3_(file_format)&amp;printable=yes" rel="alternate" title="Printable version of this page [p]" accesskey="p">Printable version</a></li>				<li id="t-permalink"><a href="/w/index.php?title=MD3_(file_format)&amp;oldid=321603583" title="Permanent link to this revision of the page">Permanent link</a></li><li id="t-cite"><a href="/w/index.php?title=Special:Cite&amp;page=MD3_(file_format)&amp;id=321603583" title="Information on how to cite this page">Cite this page</a></li>			</ul>
		</div>
	</div>
		</div><!-- end of the left (by default at least) column -->
			<div class="visualClear"></div>
			<div id="footer">
				<div id="f-poweredbyico"><a href="http://www.mediawiki.org/"><img src="/skins-1.5/common/images/poweredby_mediawiki_88x31.png" height="31" width="88" alt="Powered by MediaWiki" /></a></div>
				<div id="f-copyrightico"><a href="http://wikimediafoundation.org/"><img src="/images/wikimedia-button.png" width="88" height="31" alt="Wikimedia Foundation"/></a></div>
			<ul id="f-list">
					<li id="lastmod"> This page was last modified on 23 October 2009 at 17:10.</li>
					<li id="copyright">Text is available under the <a rel="license" href="http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License">Creative Commons Attribution-ShareAlike License</a><a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/" style="display:none;"></a>;
additional terms may apply.
See <a href="http://wikimediafoundation.org/wiki/Terms_of_Use">Terms of Use</a> for details.<br/>
Wikipedia&reg; is a registered trademark of the <a href="http://www.wikimediafoundation.org/">Wikimedia Foundation, Inc.</a>, a non-profit organization.</li>
					<li id="privacy"><a href="http://wikimediafoundation.org/wiki/Privacy_policy" title="wikimedia:Privacy policy">Privacy policy</a></li>
					<li id="about"><a href="/wiki/Wikipedia:About" title="Wikipedia:About">About Wikipedia</a></li>
					<li id="disclaimer"><a href="/wiki/Wikipedia:General_disclaimer" title="Wikipedia:General disclaimer">Disclaimers</a></li>
			</ul>
		</div>
</div>

<script type="text/javascript">if (window.runOnloadHook) runOnloadHook();</script>
<!-- Served by srv153 in 0.063 secs. --></body></html>
